﻿#pragma once

#include <QVulkanWindow>
#include <QVulkanInstance>
#include <QWidget>

#include <memory>

namespace WindowsSystem
{
	//*** class: Renderer
	//*** data : 2023/9/22
	//*** note : 渲染对象renderer类
	class Renderer : public QVulkanWindowRenderer
	{
	public:
		Renderer(QVulkanWindow* w) : _window(w), _device_func(nullptr) {}

		void initResources()  override;
		void startNextFrame() override;
	
	private:
		QVulkanWindow*          _window;
		QVulkanDeviceFunctions* _device_func;
	};

	//*** class: RenderWindow
	//*** data : 2023/9/22
	//*** note : 渲染窗口类
	class RenderWindow : public QVulkanWindow
	{
	public:
		RenderWindow();
		~RenderWindow();

		QVulkanWindowRenderer* createRenderer() override;

	private:
		QVulkanInstance* _inst;
	};

	//*** class: RenderWidget
	//*** data : 2023/9/23
	//*** note : 渲染widget类
	class RenderWidget : public QWidget
	{
	public:
		explicit RenderWidget(RenderWindow* window);
		~RenderWidget();

	private:
		RenderWindow* _window;
	};
}

